"""
下标0的开始，依次扫描，较大元素交换
"""
import random


def mpSort(nums):
    if not nums:
        return nums
    for i in range(len(nums)):
        for j in range(1, len(nums) - i):
            if nums[j] < nums[j - 1]:
                nums[j], nums[j - 1] = nums[j - 1], nums[j]
    return nums


if __name__ == '__main__':
    ls = [random.randint(0, 100) for _ in range(10)]
    print(ls)
    print(mpSort(ls))

